/**
 * 
 */
package org.jenkon.commons.lang.comparator;

import java.util.Comparator;

/**
 * @author Jens Konopka
 * 
 * @param <T>
 */
public class ReverseComparator<T> implements Comparator<T> {

	private final Comparator<T> comparator;

	/**
	 * @param comparator
	 */
	public ReverseComparator(final Comparator<T> comparator) {
		this.comparator = comparator;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
	 */
	@Override
	public int compare(final T left, final T right) {
		return comparator.compare(right, left);
	}

}
